export default{
  namespaced:true,
  state:{
    token:uni.getStorageSync('token')||'',
    userInfo:JSON.parse(uni.getStorageSync('userInfo')||'{}')
  },
  actions:{},
  mutations:{
    saveUserInfo(state,data){
      state.userInfo=data
      uni.setStorageSync('userInfo',JSON.stringify(data))
    },
    saveToken(state,data){
      state.token=data
      uni.setStorageSync('token',data)
    },
    loginout(state,data,){
      state.token=''
      state.userInfo={}
      uni.removeStorageSync('token')
      uni.removeStorageSync('userInfo')
      uni.removeStorageSync('address')
     
    }
  },
  getters:{}
  
}